/*
 * GLUT Shapes Demo
 *
 * Written by Nigel Stewart November 2003
 *
 * This program is test harness for the sphere, cone
 * and torus shapes in GLUT.
 *
 * Spinning wireframe and smooth shaded shapes are
 * displayed until the ESC or q key is pressed.  The
 * number of geometry stacks and slices can be adjusted
 * using the + and - keys.
 */
#include <windows.h>
#ifdef __APPLE__
#include <GLUT/glut.h>
#else
#include <GL/glut.h>
#endif
#include <math.h>
#include <stdlib.h>

void init (void)
{
    glClearColor (1.0,1.0,1.0,0.0);
    glMatrixMode (GL_PROJECTION);
    gluOrtho2D (0.0,200.0,0.0,150.0);

}

void lineSegment (void)
{
    glClear (GL_COLOR_BUFFER_BIT);
    glColor3f (0.0,0.4,0.2);
    glBegin  (GL_LINES);
        glVertex2i (180,15);
        glVertex2i (10,145);
    glEnd ();
    glFlush ();
}

int main(int argc, char *argv[])
{
    glutInit(&argc, argv);
    glutInitWindowSize(400,300);
    glutInitWindowPosition(50,100);
    glutInitDisplayMode(GLUT_RGB | GLUT_SINGLE);

    glutCreateWindow("An Example OpenGL Program");


    init ();
    glutDisplayFunc (lineSegment);

    glutMainLoop();

    return 0;
}
